import Vue from "vue";
import App from "./App.vue";

// 清除默认样式
import "@/assets/reset.css";

import Header from "./components/header";
import Footer from "./components/footer";
import TypeNav from "./components/typeNav";
import Pagination from "./components/pagination";
Vue.config.productionTip = false;
Vue.component(Header.name, Header);
Vue.component(Footer.name, Footer);
Vue.component(TypeNav.name, TypeNav);
Vue.component(Pagination.name, Pagination);
import router from "./routers";
import store from "./store";
import "@/mock/mockServer";
import { Swiper, SwiperSlide } from "vue-awesome-swiper";
import "swiper/css/swiper.min.css";
Vue.component("Swiper", Swiper);
Vue.component("SwiperSlide", SwiperSlide);
//element-ui
import ElementUI from "element-ui";
import "element-ui/lib/theme-chalk/index.css";
Vue.use(ElementUI);

import "@/utils/validate";
//图片懒加载
import VueLazyload from "vue-lazyload";
import loading from "@/assets/loading.gif";
import error from "@/assets/error.gif";
//安装插件
Vue.use(VueLazyload, {
  error,
  loading,
});

import "@/permisstion";
import * as ajax from "@/api";
new Vue({
  beforeCreate() {
    Vue.prototype.$bus = this;
    Vue.prototype.$ajax = ajax;
  },
  store,
  router,
  render: (h) => h(App),
}).$mount("#app");
